package cn.tedu.storage.controller;

import cn.tedu.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName StorageController
 * @Description:类描述
 * @Author Tedu
 * @Date 2021/7/1 11:07
 * @Version V1.0
 **/
@RestController
public class StorageController {
    @Autowired
    private StorageService storageService;
    @GetMapping("/decrease") //RequestParam可省略 普通get方法访问?key1=Value1&参数2 http://localhost:8082/decrease?productId=1&count=-1
    public String decrease(Long productId,Integer count){
        storageService.decrease(productId, count);
        return "减少商品库存成功";
    }
}
